package com.huika.dealontop.utils;

import android.util.Log;

/**
 * Created by yangyuan on 2016/1/13.
 */
public class StringUtils {

    public static String dealStrPhone(String str) {
        StringBuilder sb = new StringBuilder();
        sb.append(str.substring(0, 3));
        for (int i = 3; i < str.length() - 3; i++) {
            sb.append("*");
        }
        sb.append(str.substring(str.length() - 3, str.length()));
        Log.d("cy", "加密后的电话为：" + sb.toString());
        return sb.toString();
    }

    public static String dealStrEmail(String str) {
        StringBuilder sb = new StringBuilder();

        String arr[] = str.split("@");

        sb.append(arr[0].substring(0, 3));
        for (int i = 3; i < arr[0].length(); i++) {
            sb.append("*");
        }
        sb.append("@" + arr[1]);
        Log.d("cy", "加密后的邮箱为：" + sb.toString());
        return sb.toString();
    }

}
